//
//  BaseModel.m
//  Project_B
//
//  Created by 张闯的mac pro on 15/11/23.
//  Copyright © 2015年 张闯. All rights reserved.
//

#import "BaseModel.h"

@implementation BaseModel

- (instancetype)initWithDic:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

+ (instancetype)modelWithDic:(NSDictionary *)dic
{
    id model = [[[self class] alloc] initWithDic:dic];
    return model;
}

+ (NSMutableArray *)transformWithArray:(NSArray *)array
{
    NSMutableArray *tempArr = [NSMutableArray array];
    for (NSDictionary *dic in array) {
        @autoreleasepool {
            id model = [self modelWithDic:dic];
            [tempArr addObject:model];
        }
    }
    return tempArr;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}



@end
